Back to course home
0% completed
Vote For New Content
Appendix
Contact Us
Subsequence Pattern Matching
Problem Statement
Given a string and a pattern, write a method to count the number of times the pattern appears in the string as a subsequence.
Example 1:
Input: string: "baxmx", pattern: "ax"
Output: 2
Explanation: {baxmx, baxmx}.
Example 2:
Input: string: "tomorrow", pattern: "tor"
Output: 4
Explanation: Following are the four occurences: {tomorrow, tomorrow, tomorrow, tomorrow}.
Try it yourself
Try solving this question here:
Java
Saved to Cloud
. . . .
Solution: Longest Repeating Subsequence
Solution: Subsequence Pattern Matching
Mark as Completed
On this page
Problem Statement
Try it yourself